(*      File name: Binary.def                                   *)
(*      Creation : 7/5/85                                       *)
(*      Function : Read Binary data from a File                 *)
(*      By       : Morris                                       *)
(*                                                              *)
(*
*    Copyright (c) 1985,1986,1987,1988,1989 by
*    ana-systems, Foster City, California.
*    All Rights Reserved.
*     
*    This software is furnished under a license and may be used and copied
*    only  in accordance with  the  terms  of  such  license and  with the
*    inclusion of the above copyright notice.  This software or  any other
*    copies thereof may not be provided or otherwise made available to any
*    other  person.   No title to and ownership of the  software is  herby
*    transferred.
*
*    The information in this software is  subject to change without notice
*    and  should  not be construed as a commitment by ana-systems.   No
*    warranty is implied or expressed.
*
*  SCCID  = "1.2    10/8/86"; 
*)
(*      History of modifcation                                  *)
(*      Date            Who             Why                     *)
(*      9/22/86         Morris          Use BYTE from SYSTEM    *)
(*                                                              *)
DEFINITION MODULE Binary;
FROM Files IMPORT File, FileState;
FROM SYSTEM IMPORT ADDRESS,WORD,BYTE;

EXPORT QUALIFIED 
    ReadByte,ReadWord,ReadBlock,ReadBytes,
    WriteByte,WriteWord,WriteBlock,WriteBytes;



PROCEDURE ReadByte(   file : File;
                 VAR  byte : BYTE;
                 VAR state : FileState);
 
PROCEDURE ReadWord(   file : File;
                  VAR word : WORD ;
                 VAR state : FileState);

PROCEDURE ReadBlock(  file : File;
                 VAR block : ARRAY OF BYTE;
                 VAR state : FileState);

PROCEDURE ReadBytes(  file : File;
                      addr : ADDRESS;
                      bytes : CARDINAL;
             VAR bytesread : CARDINAL;
             VAR     state : FileState);
        (* bytesread returns the actual of byte read and
           the user should do check on the number *)

PROCEDURE WriteByte(  file : File;
                      byte : BYTE;
                 VAR state : FileState);

PROCEDURE WriteWord(  file : File;
                      word : WORD ;
                 VAR state : FileState);

PROCEDURE WriteBlock( file : File;
                 VAR block : ARRAY OF BYTE;
                 VAR state : FileState);

PROCEDURE WriteBytes( file : File;
                      addr : ADDRESS;
                     bytes : CARDINAL;
            VAR byteswrite : CARDINAL;
            VAR state      : FileState);
END Binary .
